/**
 * Created by zhenggongbu on 2016-04-06.
 */
//$("#back-news").on("tap",function(){
//    $(this).css("background-color","rgba(0, 0, 0, 0.1)");
//    window.history.back(-1);
//});
function back12(){
    window.history.back(-1);
}
window.onload=function(){
    setInterval(navbind,10)
};
var ids=GetQueryString("id");
//
/*angularjs*/
var myApp=angular.module("myApp",[]);//定义模块，[]代表组件，如果没有就为空，但不能删除，必须要
myApp.controller("Viewdetails",function($scope,$http){
    $scope.findbook=function(){
        $http.post("Viewdetails.do",{title1:ids}).success(function(data){
            console.log(data);
            $scope.msg=data;
            for(var i=0;i<=data.length-1;i++){
                //console.log(typeof (data[i].publish_date));
                var strs= new Array(); //定义一数组
                strs=data[i].publish_date.split("T"); //字符分割
                console.log(strs[0]);
                data[i].publish_date=strs[0];

            }
        })
    };
    $scope.findbook2=function(){
        $http.post("Viewdetails2.do",{title2:ids}).success(function(data1){
            console.log(data1);
            $scope.msg1=data1;
        })
    }
});


/*点赞后的改变*/
//$("#dianzhan").on("tap",function(){
//    $(this).css("color","red")
//}

/*获取传递的值*/
function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}

// 调用方法
//alert(GetQueryString("id"));